from typing import List

# Shift Row
class SR:
    def __init__(self) -> None:
        pass
    
    # Shift Row
    def encrypt(self, nums: List[List[int]]) -> List[List[int]]:
        # shift left
        nums[1] = [nums[1][1],nums[1][2],nums[1][3],nums[1][0]]
        nums[2] = [nums[2][2],nums[2][3],nums[2][0],nums[2][1]]
        nums[3] = [nums[3][3],nums[3][0],nums[3][1],nums[3][2]]
        
        return nums

    # Inverse Shift Row
    def decrypt(self, nums: List[List[int]]) -> List[List[int]]:
        # shift right
        nums[1] = [nums[1][3],nums[1][0],nums[1][1],nums[1][2]]
        nums[2] = [nums[2][2],nums[2][3],nums[2][0],nums[2][1]]
        nums[3] = [nums[3][1],nums[3][2],nums[3][3],nums[3][0]]
        
        return nums


# for debug
# n = [[110, 35, 54, 30], [251, 212, 204, 227], [83, 89, 79, 82], [3, 29, 60, 192]]
# print(n)
# n = SR().encrypt(n)
# print(n)
# n = SR().decrypt(n)
# print(n)